package com.zhongxi.guoyuan.view.personalCenter;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.zhongxi.guoyuan.R;
import com.zhongxi.guoyuan.base.BaseActivity;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class HasConsumeHomeActivity extends BaseActivity implements View.OnClickListener {


    @Bind(R.id.rela_hasconsume_beauty)
    RelativeLayout relaHasconsumeBeauty;
    @Bind(R.id.rela_hasconsume_online)
    RelativeLayout relaHasconsumeOnline;
    @Bind(R.id.rela_hasconsume_facetoface)
    RelativeLayout relaHasconsumeFacetoface;
    @Bind(R.id.rela_hasconsume_offline)
    RelativeLayout relaHasconsumeOffline;
    @Bind(R.id.rela_hasconsume_bean)
    RelativeLayout relaHasconsumeBean;
    private ImageView ivBack;
    private TextView tvTitle;

    @Override
    protected void initView() {
        super.initView();
        setContentView(R.layout.activity_has_consume_home);
        ButterKnife.bind(this);
        ivBack = (ImageView) findViewById(R.id.ivBack);
        tvTitle = (TextView) findViewById(R.id.tvTitle);
        tvTitle.setText("消费记录");

    }

    @Override
    protected void initTitle() {
        super.initTitle();
    }

    @Override
    protected void initEvent() {
        super.initEvent();
        ivBack.setOnClickListener(this);

    }

    @Override
    protected void initData() {
        super.initData();
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.ivBack:
                onBackPressed();
                finish();
                break;
        }
    }

    @OnClick({R.id.rela_hasconsume_beauty, R.id.rela_hasconsume_online, R.id.rela_hasconsume_facetoface, R.id.rela_hasconsume_offline, R.id.rela_hasconsume_bean})
    public void onViewClicked(View view) {
        Intent intent=new Intent(this,HasConsumeActivity.class);
        int index=0;
        switch (view.getId()) {
            case R.id.rela_hasconsume_beauty:
                index=0;
                break;
            case R.id.rela_hasconsume_online:
                index=1;
                break;
            case R.id.rela_hasconsume_facetoface:
                index=2;
                break;
            case R.id.rela_hasconsume_offline:
                index=3;
                break;
            case R.id.rela_hasconsume_bean:
                index=4;
                break;
        }
        intent.putExtra("index",index);
        startActivity(intent);
    }
}
